var e = getApp();

Page({
    data: {
        circleId: 0,
        circleInfo: {}
    },
    onLoad: function(e) {
        this.data.circleId = e.circleId, this.getDetails();
    },
    onReady: function() {},
    gotoCirclelssue: function() {
        wx.navigateTo({
            url: "/packageH/circleCommunity/circleIssue/circlelssue?circleId=" + this.data.circleId
        });
    },
    gotoCircleChecklist: function() {
        wx.navigateTo({
            url: "/packageH/circleCommunity/circleChecklist/circleChecklist?circleId=" + this.data.circleId
        });
    },
    gotoCircleMember: function() {
        wx.navigateTo({
            url: "/packageH/circleCommunity/circleMember/circleMember?circleId=" + this.data.circleId
        });
    },
    onShow: function() {},
    onHide: function() {},
    getDetails: function() {
        var c = this, t = e.getNetAddresss("plugin.circle.frontend.circle.get-circle");
        e._postNetWork({
            url: t,
            data: {
                circle_id: this.data.circleId
            },
            success: function(t) {
                var i = t.data;
                if (1 != i.result) return e.tips(i.msg);
                c.setData({
                    circleInfo: i.data
                }), console.log(i);
            }
        });
    },
    bindSwitchChange: function(c) {
        console.log(c);
        var t = {
            circle_id: this.data.circleId,
            authority_type: {}
        };
        t.authority_type = c.currentTarget.dataset.type;
        var i = e.getNetAddresss("plugin.circle.frontend.circle.set-circle-authority");
        e._postNetWork({
            url: i,
            data: t,
            success: function(c) {
                var t = c.data;
                if (1 != t.result) return e.tips(t.msg);
            }
        });
    },
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareTimeline: function() {},
    onShareAppMessage: function() {}
});